{% extends 'admin/public/base.html' %}

{% block title %}
<title>订单列表</title>
{% endblock %}

{% block con %}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">订单列表</div>

                </div>
                <div class="widget-body  am-fr">

                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"></span> 保存</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 审核</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <form action="" method="get">
                      <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                        <div class="am-form-group tpl-table-list-select">
                            <select name="types" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                              <option {% if request.GET.types == 'all' %} selected {% endif %} value="all">所有类别</option>
                              <option {% if request.GET.types == 'id' %} selected {% endif %} value="email">订单号</option>
                              <option {% if request.GET.types == 'username' %} selected {% endif %} value="username">用户名</option>
                              <option {% if request.GET.types == 'phone' %} selected {% endif %} value="phone">手机号</option>
                            </select>
                        </div>
                      </div>
                      <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                        <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                            <input value="{{ request.GET.keywords }}" name="keywords" type="text" class="am-form-field ">
                            <span class="am-input-group-btn">
                              <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" ></button>
                            </span>
                        </div>
                      </div>
                    </form>

                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                             <tr>
                                
                                <th>ID</th>
                                <th>用户名</th>
                                <th>电话</th>
                                <th>订单号</th>
                                <th>下单日期</th>
                                <th>状态</th>
                                <!-- <th>总金额</th> -->
                                <!-- <th>操作</th> -->
                                
                             </tr>
                            </thead>
                                   
                          <!-- more data -->
                            
                        </table>

                        {% for i in orderinfolist %}


                       <div class="am-panel-group" id="accordion">
                              <div class="am-panel am-panel-default" style="background: #5d6468;border-radius: 20px;">
                                <div class="am-panel-hd" style="background:#5d6468;border-radius: 20px;">
                                  <h4    class="am-panel-title" data-am-collapse="{parent: '#accordion', target: '#do-not-say-1{{i.id}}'}">
                                    <table  width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                    <tbody >
                                    <tr>                                    
                                    <td class="am-text-middle">{{ i.orderid.uid_id }}</td>
                                    <td class="am-text-middle"s">{{ i.orderid.uid.username }}</td>
                                    <td class="am-text-middle"s">{{ i.orderid.uid.phone }}</td>
                                    <td class="am-text-middle">{{ i.orderid_id }}</td>                                  
                                    <td class="am-text-middle">{{ i.orderid.addtime|date:'Y-m-d H:i:s' }}</td>
                                    <td class="am-text-middle">

                                        {% if i.status == 0 %}
                                            待付款
                                        {% elif i.status == 1 %}
                                            已付款,待发货
                                        {% elif i.status == 2 %}
                                            待收货
                                        {% elif i.status == 3 %}
                                            已取消
                                        {% endif %}
                                    <br>
                                    </td>

                                    <!-- <td class="am-text-middle">{{ i.orderid.totalprice }}</td> -->

                                    <!-- <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="{% url 'myadmin_user_edit' i.id %}">
                                                <i class="am-icon-pencil"></i> 编辑
                                            </a>
                                            <a href="{% url 'myadmin_user_delete' i.id %}" class="tpl-table-black-operation-del">
                                                <i class="am-icon-trash"></i> 删除
                               
                                            </a>
                                        </div>
                                    </td> -->
                                
                                   </tbody> 
                                    </table>
                                  </h4>
                                </div>
                                <div id="do-not-say-1{{i.id}}" class="am-panel-collapse am-collapse am-in">
                                  <div class="am-panel-bd">
                                    
                                    
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                    <tbody>
                                    <tr>                                    
                                    <td class="am-text-middle"><img style="height: 50px;" src="{{ i.goodsid.pic }}"></td>
                                    <td class="am-text-middle">{{ i.goodsid.title }}</td>
                                    <td class="am-text-middle">{{ i.orderid.totalprice }}</td>                                  
                                    
                                    <td class="am-text-middle">

                                        {% if i.orderid.status == 0 %}
                                            待付款
                                        {% elif i.orderid.status == 1 %}
                                            已付款,待发货
                                        {% elif i.orderid.status == 2 %}
                                            待收货
                                        {% elif i.orderid.status == 3 %}
                                            已取消
                                        {% endif %}
                                    </td>
                                    <td class="am-text-middle">{{ i.orderid.aid.addressname }}</td>
                                    <td class="am-text-middle">{{ i.orderid.aid.address }}</td>
                                    <td class="am-text-middle">{{ i.orderid.aid.addressphone }}</td>
                                    <td class="am-text-middle">{{ i.orderid.addtime|date:'Y-m-d H:i:s' }}</td>
                                   </tbody> 
                                 </table>

                           


                                  </div>
                                </div>
                              </div>
                            </div>

                        {% endfor %}



                    </div>
                    <div class="am-u-lg-12 am-cf">

                        <div class="am-fr">
                            <ul class="am-pagination tpl-pagination">
                               <!--  <li class="am-disabled"><a href="#">«</a></li>
                                <li class="am-active"><a href="#">1</a></li>
                                <li><a href="#">2</a></li>
                                <li><a href="#">3</a></li>
                                <li><a href="#">4</a></li>
                                <li><a href="#">5</a></li>
                                <li><a href="#">»</a></li> -->
                                {% load pagetag %}
                                
                                {% showpage orderlist.paginator.num_pages request %}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{% endblock %}


